import React, { Component } from 'react'
const Detaildata=[{id:'01',context:'你好，奥运'},{id:'02',context:'你好，中国'},{id:'03',context:'你好，南京'}]
export default class Detail extends Component {
    render() {
        // 从父组件中拿到传过来的值
        const {id,title}=this.props.match.params
        // 找到相同的id值，并且把context的值拿出来
        const context=Detaildata.find(item=>{
           return  item.id===id
        })
        return (
            <div>
                <ul>
                    <li>id:{id}</li>
                    <li>title:{title}</li>
                    <li>context:{context.context}</li>
                </ul>
            </div>
        )
    }
}
